package com.xuhuan.example.exmaple071;

import java.util.Date;

/**
 * @author: huan.xu
 * @create: 2023/11/14 11:29
 * @description:
 **/
public class Example071 {
    public static void main(String[] args) throws Exception {
        System.out.println("第一种方式：Object.getClass()");
        Class c1 = new Date().getClass();
        System.out.println(c1.getName());

        System.out.println("第二种方式：.class语法");
        Class c2 = boolean.class;
        System.out.println(c2.getName());

        System.out.println("第三种方式：Class.forName");
        Class c3 = Class.forName("java.lang.String");
        System.out.println(c3.getName());

        System.out.println("第四种方式：包装类的TYPE域");
        Class c4 = Double.TYPE;
        System.out.println(c4.getName());
    }
}
